<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>JSSDK示例</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css">
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>

<script src="jbase64.js"></script>
<script src="json2.js"></script>
<script src="jssdk-qk.js"></script>

<script type="text/javascript">

function JSSDKGetDeviceInfoClick(){
	JSSDKGetDeviceInfo(function(ret, msg){
		alert(ret+'\n'+msg);
	});
}

function JSSDKScanQRCodeClick(){
	JSSDKScanQRCode(function(ret, msg){
		alert(ret+'\n'+msg);
	});
}

function JSSDKGetLoginInfoClick(){
	JSSDKGetLoginInfo(function(ret, msg){
		alert(ret+'\n'+msg);
	});
}

function JSSDKShareThirdPartyClick1(){
	JSSDKShareThirdParty('测试title','测试content','http://192.168.1.107:8080/QipeimingjiaApi/images/ic_launcher.png','',function(ret, msg){
		alert(ret+'\n'+msg);
	});
}

function JSSDKShareThirdPartyClick2(){
	JSSDKShareThirdParty('测试title','测试content','http://192.168.1.107:8080/QipeimingjiaApi/images/ic_launcher.png','http://192.168.1.107:8080/QipeimingjiaApi/download/index.html',function(ret, msg){
		alert(ret+'\n'+msg);
	});
}

function JSSDKAlipayClick(){
	alert('JSSDKAlipayClick');
	$.get('../../api/alipayOrderSign?subject=test&body=testbody&orderid=201806012309&price=0.01', function(data, status){
		alert(data.ret+'\n'+data.msg);
		JSSDKAlipay(data.arg1);
	});
}

function JSSDKWxpayClick(){
	$.get('../../api/wxpayUnifiedOrderRecharge?key=&price=0.01', function(data, status){
		alert(data.ret+'\n'+data.msg);
		JSSDKWxpay(data.appid, data.partnerid, data.prepayid, data.noncestr, data.timestamp, data.packageValue, data.sign);
	});
}

function JSSDKMerchantForumListClick(){
	JSSDKMerchantForumList('', 'G16038E2E2C213FEB566CACB');
}

</script>

</head>
<body>

<input type="button" value="JSSDKToast" onclick="JSSDKToast('content')"/> <br />
<input type="button" value="JSSDKFinishPage" onclick="JSSDKFinishPage()"/> <br />
<input type="button" value="JSSDKAlert" onclick="JSSDKAlert('title', 'content', 'btnTxt')"/> <br />
<input type="button" value="JSSDKSendSms" onclick="JSSDKSendSms('13266666271', 'content')"/> <br />
<input type="button" value="JSSDKCallPhone" onclick="JSSDKCallPhone('13266666271')"/> <br />
<input type="button" value="JSSDKOpenUrlBySystem" onclick="JSSDKOpenUrlBySystem('https://www.baidu.com/')"/> <br />
<input type="button" value="JSSDKOpenUrl" onclick="JSSDKOpenUrl('baidu', 'https://www.baidu.com/')"/> <br />
<input type="button" value="JSSDKOpenUrl no menu" onclick="JSSDKOpenUrl('baidu', 'https://www.baidu.com/', true, false, true)"/> <br />
<input type="button" value="JSSDKOpenUrl no Title Layout" onclick="JSSDKOpenUrl('baidu', 'https://www.baidu.com/', true, true, false)"/> <br />
<input type="button" value="JSSDKGetDeviceInfo" onclick="JSSDKGetDeviceInfoClick()"/> <br />
<input type="button" value="JSSDKGetLoginInfo" onclick="JSSDKGetLoginInfoClick()"/> <br />
<input type="button" value="JSSDKShareTxtBySystem" onclick="JSSDKShareTxtBySystem('分享标题', '分享内容')"/> <br />

<input type="button" value="JSSDKShowProgressDialog" onclick="JSSDKShowProgressDialog('加载中...')"/> <br />
<input type="button" value="JSSDKDismissProgressDialog" onclick="JSSDKDismissProgressDialog()"/> <br />

<input type="button" value="JSSDKToLoginPage" onclick="JSSDKToLoginPage()"/> <br />
<input type="button" value="JSSDKToRegisterPage" onclick="JSSDKToRegisterPage()"/> <br />
<input type="button" value="JSSDKScanQRCode" onclick="JSSDKScanQRCodeClick()"/> <br />

<input type="button" value="JSSDKToSearchPage" onclick="JSSDKToSearchPage('')"/> <br />
<input type="button" value="JSSDKToSearchPage 搜索内容" onclick="JSSDKToSearchPage('搜索内容')"/> <br />
<input type="button" value="JSSDKToGoodsDetail" onclick="JSSDKToGoodsDetail('0')"/> <br />
<input type="button" value="JSSDKToMerchantIndex" onclick="JSSDKToMerchantIndex('0')"/> <br />
<input type="button" value="JSSDKToGoodsClassifyList" onclick="JSSDKToGoodsClassifyList('0')"/> <br />
<input type="button" value="JSSDKToShopCartPage" onclick="JSSDKToShopCartPage()"/> <br />
<input type="button" value="JSSDKShareThirdPartyClick1" onclick="JSSDKShareThirdPartyClick1();"/> <br />
<input type="button" value="JSSDKShareThirdPartyClick2" onclick="JSSDKShareThirdPartyClick2();"/> <br />

<h2>支付测试</h2>
<input type="button" value="JSSDKAlipay" onclick="JSSDKAlipayClick();"/> <br />
<input type="button" value="JSSDKWxpay" onclick="JSSDKWxpayClick();"/> <br />

<input type="button" value="JSSDKMerchantForumList" onclick="JSSDKMerchantForumListClick();"/> <br />


</body>
</html>